Cdbconnection: An abstract database connectionCdbcommand:sql statementCdbdatareader: A row of records matching a result setCdbtransaction: Database Transactions
You need to establish a database connection before accessing the database, and use DAO
Yii provides detailed examples of the Model query technique based on arrays and objects, and yiimodel. Yii provides an example of the Model query technique based on arrays and objects. yiimodel describes the Model query technique of Yii based on
Modeling (model) creation and use in Yii, Yiimodel
In this paper, we analyze the creation and use of model (models) in Yii. Share to everyone for your reference, as follows:
YII implements two models, the form model (Cformmodel Class) and the
Yii Model Layer Operation summary
A summary of the operation properties and methods of Yii model layer.
tablename– set the table name corresponding to the model, for example:
Public Function TableName () {return ' Gshop_order_ext ';}
rules– setting
Public Function Getminlimit () {$sql = "...";$result = Yii::app ()->db->createcommand ($sql);$query = $result->queryall ();Return Array ($query [0] [' Max '],);}$connection =Yii::app ()->db;$sql = "Select u.account,i.* from Sys_user as U left joins
Public Function Getminlimit () {$sql = "...";$result = Yii::app ()->db->createcommand ($sql);$query = $result->queryall ();Return Array ($query [0] [' Max '],);}$connection =Yii::app ()->db;$sql = "Select u.account,i.* from Sys_user as U left joins
There are many implementation methods for yii database operations. The following summarizes a set of statements for yii database operations:1. Query data (select) The code is as follows:Copy code $ Con = Yii: app ()-> db;// Query a row of data$
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.